In a large scale computer system, such as a database management system (DBMS), it is important to be able to support a number of different users concurrently. Without such a capability, the system would be little more than a standalone computer. To implement multi-user support, several different processing models have been utilized to manipulate data. One model that has been used is the multi-processing model. In multi-processing, each time a new user requests access to the system, a separate process is started. This process is in essence a separate execution of the software. Once started, the process services all of the requests from the user that spawned it. Under the multi-processing model, each process has its own separate memory space for use in accessing (e.g., storing and processing) data.
Multi-processing is effective for supporting multiple users concurrently; however, it has severe scalability limitations. This is due mainly to two factors. First, spawning and maintaining a process involves a significant amount of overhead. Because of the high cost, only a small number of processes can be maintained at any one time. Second, the same set of data, used by multiple processes, may be stored redundantly; once in each process' memory space. This redundancy can waste a significant amount of system resources.
To overcome some of the limitations of multi-processing, the multi-thread model was developed. According to the multi-thread model, there is only one execution of the software. That is, only one process is spawned. From this one process, multiple threads can be spawned to perform the work necessary to service user requests.
Multi-threading has several advantages over multi-processing. First, because only one process is spawned, overhead is kept to a minimum. It is true that each thread carries with it some overhead cost, but this cost is negligible when compared with the cost of maintaining an entire process. Because multi-threading significantly reduces system overhead, many more users can be supported. Another advantage of multi-threading is that it minimizes the redundant storage of data. Because all of the threads are part of the same process, all of the threads can share the same memory space. This in turn makes it easier to implement a shared cache, where it is only necessary to store a set of data once.
Caches are generally used to provide ready access to data read from or being written to a disk. Caches can be implemented in hardware, software or a combination of hardware and software and can be utilized by any data processing paradigm, including single-process, multi-processing and multi-threading. In a general purpose computing system, a cache system fully supports both the reading of data from and the writing of data to disk. Each block of data stored in a cache can typically be marked by an owning data accessor, such as a process or thread.
In virtual memory systems, a paging system attempts to maintain the most-recently-used pages in the cache. This requires that cached pages are routinely written to disk to make room for new data. A data accessor, however, may require that a particular page remain in cache memory for an extended period of time. To satisfy this requirement, the accessor and the paging system typically interact through a system of locks. While a cached page is locked, the paging system keeps that page in the cache.
Page locks are typically managed by the software written to control the data accessor. In general, an accessor requests a lock on a page through the paging system and waits for the lock request to be satisfied. If the page is currently locked by another accessor, there may be a delay in receiving the lock resource. Once the page is locked, the accessor can rely on that page to remain in cache memory for reads and writes. That is, the paging system will honor the lock and will not swap the page out of memory until the accessor releases the lock.
To operate currently, application software is written and debugged to manage page locks. In large scale computer systems, the human cost of implementing lock management requirements throughout the application is especially high. This cost can escalate in large multi-threadable applications. Hence, there is a need for a simplified page locking system.